;;; +yasnippet.el --- Initialization and mode setting.

;;; Homepage:
;; https://github.com/joaotavora/yasnippet

;;; Commentary:
;; A system of templates.

;;; Code:

(use-package yasnippet
  :ensure
  :hook
  (emacs-startup . yas-reload-all)
  (prog-mode . yas-minor-mode)
  :bind
  (:map yas-keymap
	("TAB" . nil)
	("<tab>" . nil)
	("<M-right>" . yas-next-field)
	("<M-left>" . yas-prev-field)
	("<backtab>" . nil))
  :init
  (setq yas-snippet-dirs (list (expand-file-name "snippets" spruce-third-truedirectory))
	yas-wrap-around-region t)
  :config
  (use-package warnings
    :config
    (add-to-list 'warning-suppress-types '(yasnippet backquote-change)))

  (set-face-attribute 'yas-field-highlight-face nil
		      :background 'unspecified
		      :foreground (face-attribute 'font-lock-doc-face :foreground)
		      :weight 'normal))

(provide '+yasnippet)

;;; +yasnippet.el ends here
